﻿Public Class AddTokenView
    Public Sub New(obj As RawObject, insertIndex As Integer)
        MyBase.New()

        InitializeComponent()

        Me.DataContext = New AddTokenVm(obj, insertIndex)
    End Sub

    Protected Overrides Function GetHandledMessageTypes() As List(Of Type)
        Return New List(Of Type)({GetType(Messages.Common.CloseDialog)})
    End Function

    Protected Overrides Sub HandleMessage(sender As KeyedViewModelBase, message As MessageBase)
        Select Case message.GetType
            Case GetType(Messages.Common.CloseDialog)
                Me.DialogResult = CType(message, Messages.Common.CloseDialog).DialogResult
        End Select
    End Sub
End Class
